<?php $this->load->view('navmenu');?>
<div class="maincontent">
        	<div class="contentinner">
            <h2 class="widgettitle ctitle">.:: Shop Drawing : <?=$thread['subject'];?> ::.</h2>
                        <div class="widgetcontent">
						</div><!--widgetcontent-->
						<div id="accordion2" class="accordion2">
                                    <h3><a href="#">Dikirim Oleh <?=$thread['username']?> , Tanggal <?=date('d-m-Y h:i:s',strtotime($thread['date']))?></a></h3>
                                    <div>
                                        <p>
										Subject : <?=$thread['subject']?> 
										</p>
										<p>
										To : <?=$thread['kepada']?> 
										</p>
										<p>
										Drawing Title : <?=$thread['draw_title']?> 
										</p>
										<p>
										Drawing Number : <?=$thread['draw_number']?> 
										</p>
										<p>
										Location : <?=$thread['location']?> 
										</p>
                                       
										<div class="mediamgr_content">
										<ul class="listfile">
										<?php foreach($files as $file): ?>
										<?php 
										
										if($file['id_sd_thread']==$thread['id_sd_thread'])
										{
										?>
											<li>
												<a href="<?php echo base_url();?>assets/file_upload/<?=$file['nama_file']?>" data-rel="image">
												<?php
												if(strpos($file['nama_file'],'jpg') == TRUE OR strpos($file['nama_file'],'png') == TRUE)
												{
												?>
													<img src="<?php echo base_url();?>assets/template/img/thumbs/image-icon.png" width=60 height=100 alt="" /></a>
												<?php
												}
												elseif(strpos($file['nama_file'],'pdf') == TRUE)
												{
												?>
													<img src="<?php echo base_url();?>assets/template/img/thumbs/pdf.png" width=60 height=100 alt="" /></a>
												<?php
												}
												elseif(strpos($file['nama_file'],'docx') == TRUE OR strpos($file['nama_file'],'doc') == TRUE)
												{
												?>
													<img src="<?php echo base_url();?>assets/template/img/thumbs/doc.png" width=60 height=100 alt="" /></a>
												<?php
												}
												else
												{
												?>
													<img src="<?php echo base_url();?>assets/template/img/thumbs/doc.png" alt="" /></a>
												<?php
												}
												?>
												
												<span class="filename"><?=$file['nama_file']?></span>
											</li>
										<?php
										}
										?>
										<?php endforeach; ?>
										</ul>
										<br class="clearall" />
                        
										</div><!--mediamgr_content-->
                                    </div>
						</div><!--#accordion-->
						<br/>
						<br/>
						<br/>
						<h2 class="widgettitle ctitle">APPROVAL SHOP DRAWING</h2>
						<?php foreach($approvals as $approve): ?>
						<div id="accordion2" class="accordion2">
						<h3><a href="#">Di-Appove Oleh <?=$approve['username']?> , Tanggal <?=date('d-m-Y h:i:s',strtotime($approve['tanggal']))?></a></h3>
                                    <div>
                                        <p>
										Subject : <?=$approve['subject']?> 
										</p>
										<p>
										To : <?=$approve['kepada']?> 
										</p>
										<p>
										Drawing Title : <?=$approve['drawing_title']?> 
										</p>
										<p>
										Drawing Number : <?=$approve['drawing_no']?> 
										</p>
										<p>
										File Approval : <?=$approve['file_name']?> 
										<div class="mediamgr_content">
										<ul class="listfile">
											<li>
												<a href="<?php echo base_url();?>assets/file_upload/<?=$approve['file_name']?>" data-rel="image">
												<img src="<?php echo base_url();?>assets/template/img/thumbs/image-icon.png" width=60 height=100 alt="" /></a>
											</li>
										</ul>
										<br class="clearall" />
                        
										</div><!--mediamgr_content-->
										</p>
                                    </div>
						</div><!--#accordion-->
						<?php endforeach; ?>	
            </div><!--contentinner-->
        </div><!--maincontent-->